package com.nuc.bigdata.feign;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.nuc.bigdata.domain.entity.User;
import com.nuc.bigdata.exception.BusinessException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author JackLuo
 * @date 2019/10/11
 */
@FeignClient(name = "oa-user")
public interface LoginServiceFeign {
    /**
     * 调用用户服务中的登陆功能
     * @param loginName 用户名
     * @param password 密码
     * @return 用户对象
     */
    @GetMapping("/oa-user/user")
    @HystrixCommand(ignoreExceptions = BusinessException.class)
    User toLogin(@RequestParam("loginName") String loginName, @RequestParam("password") String password) throws Exception;
}
